import request from '@/utils/request'
import { getToken } from '@/utils/auth' // get token from cookie
export function exportLoan(data) {
  return request({
    headers:{
      'Authorization':getToken(),
　　},
    url: '/loan/template/exportLoanStatistics',
    method: 'get',
    responseType: 'blob',
    params: data
  })
}
export function deleteQuery(id) {
  return request({
    headers:{
      'Content-Type':'application/json',
      'Authorization':getToken(),
　　},
    url: '/loan/enterprise/delete/' + id,
    method: 'post',
  })
}
export function tableInfo(data) {
  return request({
    headers:{
      'Content-Type':'application/json',
      'Authorization':getToken(),
　　},
    url: '/loan/statistics/list',
    method: 'post',
    data
  })
}
export function output(data) {
  return request({
    headers:{
      'Authorization':getToken(),
　　},
    url: '/loan/template/exportAuditList',
    method: 'get',
    responseType: 'blob',
    params: data
  })
}
export function overCheck(id) {
  return request({
    headers:{
      'Content-Type':'application/x-www-form-urlencoded',
　　　 'Authorization':getToken()
　　},
    url: '/loan/audit/companyAuditList/finish/' + id,
    method: 'post',
  })
}
export function allPass(id) {
  return request({
    headers:{
      'Content-Type':'application/json',
　　　 'Authorization':getToken()
　　},
    url: '/loan/audit/companyAuditList/allPass/' + id,
    method: 'post',
  })
}
export function allNoPass(data) {
  return request({
    headers:{
      'Content-Type':'application/json',
　　　 'Authorization':getToken()
　　},
    url: '/loan/audit/companyAuditList/allRefuse',
    method: 'post',
    params: data
  })
}
export function noPass(data) {
  return request({
    headers:{
      'Content-Type':'application/json',
　　　 'Authorization':getToken()
　　},
    url: '/loan/audit/companyAuditList/refuse',
    method: 'post',
    params: data
  })
}
export function dataPass(data) {
  return request({
    headers:{
      'Content-Type':'application/json',
　　　 'Authorization':getToken()
　　},
    url: '/loan/audit/companyAuditList/pass',
    method: 'post',
    params: data
  })
}
export function jointTrialLook(data) {
  return request({
    headers:{
      'Content-Type':'application/json',
　　　 'Authorization':getToken()
　　},
    url: '/loan/audit/companyAuditList',
    method: 'post',
    data
  })
}
export function getAuditList(data) {
  return request({
    headers:{
      'Content-Type':'application/x-www-form-urlencoded',
　　　 'Authorization':getToken()
　　},
    url: '/loan/audit/auditList',
    method: 'get',
    params: data
  })
}
export function allBatchDelete(id) {
  return request({
    headers:{
      'Content-Type':'application/json',
　　　 'Authorization':getToken()
　　},
    url: '/loan/task/delete/' + id,
    method: 'post',
  })
}
export function batchDelete(id) {
  return request({
    headers:{
      'Content-Type':'application/json',
　　　 'Authorization':getToken()
　　},
    url: '/loan/task/batchDelete/' + id,
    method: 'post',
  })
}
export function allSubmit(id) {
  return request({
    headers:{
      'Content-Type':'application/json',
　　　 'Authorization':getToken()
　　},
    url: '/loan/task/submit/' + id,
    method: 'post',
  })
}
export function submit(id) {
  return request({
    headers:{
      'Content-Type':'application/json',
　　　 'Authorization':getToken()
　　},
    url: '/loan/task/batchSubmit/' + id,
    method: 'post',
  })
}
export function getRecieveList() {
  return request({
    headers:{
      'Content-Type':'application/x-www-form-urlencoded',
　　　 'Authorization':getToken()
　　},
    url: '/loan/task/selectInstitutionList',
    method: 'post',
  })
}
export function selectbankList() {
  return request({
    headers:{
      'Content-Type':'application/x-www-form-urlencoded',
　　　 'Authorization':getToken()
　　},
    url: '/loan/selectbankList',
    method: 'post',
  })
}
export function creatWork(data) {
  return request({
    headers:{
      'Content-Type':'application/json',
　　　 'Authorization':getToken()
　　},
    url: '/loan/task/add',
    method: 'post',
    data
  })
}
export function getList(query) {
  return request({
    headers:{
　　　'Authorization':getToken()
　　},
    url: '/loan/task/list',
    method: 'get',
    params: query
  })
}
export function cancelOpt(id) {
  return request({
    headers:{
      'Content-Type':'application/x-www-form-urlencoded',
　　　 'Authorization':getToken()
　　},
    url: '/loan/task/stop/' + id,
    method: 'post',
  })
}
export function listPreview(id) {
  return request({
    headers:{
      'Content-Type':'application/x-www-form-urlencoded',
　　　 'Authorization':getToken()
　　},
    url: '/loan/task/provinceDetail/' + id,
    method: 'post',
  })
}
export function listPreviewCity(data) {
  return request({
    headers:{
      'Content-Type':'application/json',
　　　 'Authorization':getToken()
　　},
    url: '/loan/task/otherDetail/',
    method: 'post',
    data
  })
}
export function companyPreview(id) {
  return request({
    headers:{
      'Content-Type':'application/json',
　　　 'Authorization':getToken()
　　},
    url: '/loan/task/otherDetail/' + id,
    method: 'post',
  })
}
export function audit(data) {
  return request({
    headers:{
      'Content-Type':'application/json',
　　　 'Authorization':getToken()
　　},
    url: '/loan/task/audit/',
    method: 'post',
    data
  })
}
export function getCheckList() {
  return request({
    headers:{
      'Content-Type':'application/x-www-form-urlencoded',
　　　 'Authorization':getToken()
　　},
    url: '/loan/task/selecthuishenList',
    method: 'post',
  })
}
export function overUdit(id) {
  return request({
    headers:{
      'Content-Type':'application/x-www-form-urlencoded',
　　　 'Authorization':getToken()
　　},
    url: '/loan/task/stophuishen/' + id,
    method: 'post',
  })
}
export function downLoadExampel() {
  return request({
    headers:{
      'Authorization':getToken(),
　　},
    url: '/loan/template/exportTemplate',
    method: 'get',
    responseType: 'blob',
  })
}
export function upLoadExampel(data) {
  return request({
    headers:{
　　　'Content-Type':'multipart/form-data',
      'Authorization':getToken()
　　},
    url: '/loan/template/importList',
    method: 'post',
    data
  })
}

export function queryList(data) {
  return request({
    headers:{
　　　'Content-Type':'application/json',
      'Authorization':getToken()
　　},
    url: '/loan/enterQuery',
    method: 'post',
    params: data,
  })
}

export function dateList(query) {
  return request({
    headers:{
　　　'Authorization':getToken()
　　},
    url: '/jinxinquestion/questionnaire/list',
    method: 'get',
    params: query
  })
}


export function addLists(data) {
  return request({
    headers:{
　　　'content-type':'application/json',
      'Authorization':getToken()
　　},
    url: '/jinxinquestion/questionnaire/add',
    method: 'post',
    data
  })
}
export function deleteList(data) {
  return request({
    headers:{
      'Authorization':getToken(),
　　　'content-type':'application/x-www-form-urlencoded'
　　},
    url: '/jinxinquestion/questionnaire/delete/' + data,
    method: 'post',
    // params: data
  })
}

export function editList(data) {
  return request({
    headers:{
      'Authorization':getToken(),
　　　'content-type':'application/json'
　　},
    url: '/jinxinquestion/questionnaire/update',
    method: 'post',
    data
  })
}
export function previewList(data) {
  return request({
    headers:{
      'Authorization':getToken(),
　　　'content-type':'application/x-www-form-urlencoded'
　　},
    url: '/jinxinquestion/questionnaire/view/' + data,
    method: 'post',
    // params: data
  })
}

export function companyInfoList(data) {
  return request({
    headers:{
      'Authorization':getToken(),
　　　'content-type':'application/json'
　　},
    url: '/jinxinquestion/result/list',
    method: 'post',
    data
  })
}
export function downLoadCompany(data) {
  return request({
    headers:{
      'Authorization':getToken(),
　　},
    url: '/jinxinquestion/template/exportCompanyAnswer?questionnaireId=' + data,
    method: 'get',
    responseType: 'blob',
    // params: data
  })
}

export function detailList(data) {
  return request({
    headers:{
      'Authorization':getToken(),
　　},
    url: '/jinxinquestion/result/detail/',
    method: 'post',
    data
  })
}

export function overList(data) {
  return request({
    headers:{
      'content-type':'application/x-www-form-urlencoded',
      'Authorization':getToken(),
　　},
    url: '/jinxinquestion/questionnaire/stop/' + data,
    method: 'post',
  })
}

export function infoList() {
  return request({
    headers:{
      'content-type':'application/x-www-form-urlencoded',
      'Authorization':getToken(),
　　},
    url: '/common/queryResult',
    method: 'get',
  })
}

export function getCompanyArea() {
  return request({
    headers:{
      'content-type':'application/x-www-form-urlencoded',
      'Authorization':getToken(),
　　},
    url: '/government/workspace/areaDisturb',
    method: 'post',
  })
}

export function getCompanyTime() {
  return request({
    headers:{
      'content-type':'application/x-www-form-urlencoded',
      'Authorization':getToken(),
　　},
    url: '/government/workspace/timeTred',
    method: 'post',
  })
}

export function getFinanceArea() {
  return request({
    headers:{
      'content-type':'application/x-www-form-urlencoded',
      'Authorization':getToken(),
　　},
    url: '/government/workspace/areaProduct',
    method: 'post',
  })
}

export function getFinanceTime() {
  return request({
    headers:{
      'content-type':'application/x-www-form-urlencoded',
      'Authorization':getToken(),
　　},
    url: '/government/workspace/timeMoney',
    method: 'post',
  })
}

export function getSendNeed() {
  return request({
    headers:{
      'content-type':'application/x-www-form-urlencoded',
      'Authorization':getToken(),
　　},
    url: '/government/workspace/areaIssue',
    method: 'post',
  })
}

export function getSendTime() {
  return request({
    headers:{
      'content-type':'application/x-www-form-urlencoded',
      'Authorization':getToken(),
　　},
    url: '/government/workspace/timeIssue',
    method: 'post',
  })
}

export function getSolveNeed() {
  return request({
    headers:{
      'content-type':'application/x-www-form-urlencoded',
      'Authorization':getToken(),
　　},
    url: '/government/workspace/areaSolve',
    method: 'post',
  })
}

export function getSolveTime() {
  return request({
    headers:{
      'content-type':'application/x-www-form-urlencoded',
      'Authorization':getToken(),
　　},
    url: '/government/workspace/timeSolve',
    method: 'post',
  })
}

export function getProduct() {
  return request({
    headers:{
      'content-type':'application/x-www-form-urlencoded',
      'Authorization':getToken(),
　　},
    url: '/government/workspace/productDis',
    method: 'post',
  })
}

export function getNeedMap() {
  return request({
    headers:{
      'content-type':'application/x-www-form-urlencoded',
      'Authorization':getToken(),
　　},
    url: '/government/workspace/thermDiagram',
    method: 'post',
  })
}

export function getProductList() {
  return request({
    headers:{
      'content-type':'application/x-www-form-urlencoded',
      'Authorization':getToken(),
　　},
    url: '/government/workspace/productList',
    method: 'post',
  })
}

export function getCity() {
  return request({
    headers:{
      'content-type':'application/x-www-form-urlencoded',
      'Authorization':getToken(),
　　},
    url: '/government/workspace/cityQuery',
    method: 'post',
  })
}

export function getInsite() {
  return request({
    headers:{
      'content-type':'application/x-www-form-urlencoded',
      'Authorization':getToken(),
　　},
    url: '/common/financialOrganization',
    method: 'get',
  })
}

export function searchBar(data) {
  return request({
    headers:{
      'Authorization':getToken(),
　　},
    url: '/government/workspace/areaDisturbed',
    method: 'post',
    data
  })
}

export function searchLine(data) {
  return request({
    headers:{
      'Authorization':getToken(),
　　},
    url: '/government/workspace/timeTredsts',
    method: 'post',
    data
  })
}

export function getMenu(token) {
  return request({
    headers:{
      'content-type':'application/x-www-form-urlencoded',
      'Authorization':token,
　　},
    url: '/loan/roleMenuTreeData',
    method: 'post',
  })
}

export function searchAreaBar(data) {
  return request({
    headers:{
      'content-type':'application/json',
      'Authorization':getToken(),
　　},
    url: '/government/workspace/areaEcodis',
    method: 'post',
    data
  })
}

export function searchFinanceBar(data) {
  return request({
    headers:{
      'content-type':'application/json',
      'Authorization':getToken(),
　　},
    url: '/government/workspace/areaInstitution',
    method: 'post',
    data
  })
}

export function searchFinanceLine(data) {
  return request({
    headers:{
      'content-type':'application/json',
      'Authorization':getToken(),
　　},
    url: '/government/workspace/timeEconomic',
    method: 'post',
    data
  })
}

export function sendAreaBar(data) {
  return request({
    headers:{
      'content-type':'application/json',
      'Authorization':getToken(),
　　},
    url: '/government/demand/area',
    method: 'post',
    data
  })
}

export function sendFinanceBar(data) {
  return request({
    headers:{
      'content-type':'application/json',
      'Authorization':getToken(),
　　},
    url: '/government/demand/organization',
    method: 'post',
    data
  })
}

export function sendFinanceLine(data) {
  return request({
    headers:{
      'content-type':'application/json',
      'Authorization':getToken(),
　　},
    url: '/government/demand/time',
    method: 'post',
    data
  })
}

export function solveAreaBar(data) {
  return request({
    headers:{
      'content-type':'application/json',
      'Authorization':getToken(),
　　},
    url: '/government/solveDemand/area',
    method: 'post',
    data
  })
}

export function solveFinanceBar(data) {
  return request({
    headers:{
      'content-type':'application/json',
      'Authorization':getToken(),
　　},
    url: '/government/solveDemand/organization',
    method: 'post',
    data
  })
}

export function solveFinanceLine(data) {
  return request({
    headers:{
      'content-type':'application/json',
      'Authorization':getToken(),
　　},
    url: '/government/solveDemand/time',
    method: 'post',
    data
  })
}

export function fetchList(query) {
  return request({
    url: '/vue-element-admin/article/list',
    method: 'get',
    params: query
  })
}

export function fetchArticle(id) {
  return request({
    url: '/vue-element-admin/article/detail',
    method: 'get',
    params: { id }
  })
}

export function fetchPv(pv) {
  return request({
    url: '/vue-element-admin/article/pv',
    method: 'get',
    params: { pv }
  })
}

export function createArticle(data) {
  return request({
    url: '/vue-element-admin/article/create',
    method: 'post',
    data
  })
}

export function updateArticle(data) {
  return request({
    url: '/vue-element-admin/article/update',
    method: 'post',
    data
  })
}
